{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "4e743e45",
   "metadata": {},
   "source": [
    "### 上周学习回顾\n",
    "* A.运行python的第一行代码\n",
    "* B.观察标准库\n",
    "\n",
    "#### 重要资源\n",
    "> [python官网](https://www.python.org/)  \n",
    "> [blogs](https://www.cnblogs.com/)\n",
    "\n",
    "### 第2周学习内容\n",
    "\n",
    "#### 1.pycharm安装和jupyter notebook的安装学习\n",
    "* [pycharm官网地址](https://www.jetbrains.com/pycharm/)\n",
    "* 注意事项：下载专业版\n",
    "\n",
    "#### 2.主要学习了jupyter notebook的使用\n",
    "* [官网](https://juputer notebook.org/) 可以尝试体验，及对jupyter有具体介绍\n",
    "* 如何在自己电脑打开jupyter notebook（cmd中直接执行jupyter notebook）\n",
    "\n",
    "#### 3.github education packages\n",
    "* [github education packages](https://education.github.com/pack)\n",
    "* 注册学生账号，获取pycharm激活邮箱，为下周可以使用pycharm做准备\n",
    " \n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "54d6756a",
   "metadata": {},
   "source": [
    "### 1.课本内容运行（项目一，在奇数中找时间节点）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "42ec6dc6",
   "metadata": {},
   "source": [
    "#### 从奇数中选择对应的时间节点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cdbe060c",
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59]\n",
    "\n",
    "right_this_minute = datetime.today() .minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print (\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print (\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5a8e155",
   "metadata": {},
   "source": [
    "### 2. 变量（数字，字符串，对象）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "269947dd",
   "metadata": {},
   "source": [
    "* （1）numbers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a13fd8eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "12"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 4+8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "26216e27",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "82"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 10+6*12"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8807bc71",
   "metadata": {},
   "source": [
    "* （2）字符串"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "bcaf0563",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"doesn't\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "e29978b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesnt't\""
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'doesnt\\'t'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "54c36c07",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "ab076dab",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gaoxinyan gaoxinyan\n",
      "What is the value of name2 now?\n"
     ]
    }
   ],
   "source": [
    "name = \"gaoxinyan\"\n",
    "\n",
    "name2 = name\n",
    "print(name,name2)\n",
    "\n",
    "name = \"tuola\"\n",
    "\n",
    "print(\"What is the value of name2 now?\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84de7d1e",
   "metadata": {},
   "source": [
    "### 3. if else 条件性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a4bcf1ef",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'today' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-13-9c4a2e374030>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Saturday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Party!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Sunday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mcondition\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Headache\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m         \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Recover, then rest.\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'today' is not defined"
     ]
    }
   ],
   "source": [
    "if today == \"Saturday\":\n",
    "    print(\"Party!\")\n",
    "elif today == \"Sunday\":\n",
    "    if condition == \"Headache\":\n",
    "        print(\"Recover, then rest.\")\n",
    "    else:\n",
    "        print(\"Rest.\")\n",
    "else:\n",
    "    print(\"Work, work, work.\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
